/**
  ******************************************************************************
  * @file    _tc32l010_crc.h
  * @author  CHIPAT Application Team
  * @brief   This file contains all the functions prototypes for the CRC firmware 
  *          library.
  ******************************************************************************
  */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __XS32L010_CRC_H
#define __XS32L010_CRC_H

#ifdef __cplusplus
 extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "tc32l010.h"
#include "tc32l010_rcc.h"

/** @addtogroup tc32l010_StdPeriph_Driver
  * @{
  */

/** @addtogroup CRC
  * @{
  */
#define CRC_InputDataFormat_BYTES                 0x00000001U  /*!< Input data in byte format      */
#define CRC_InputDataFormat_HALFWORDS             0x00000002U  /*!< Input data in half-word format */
#define CRC_InputDataFormat_WORDS                 0x00000003U  /*!< Input data in word format      */
    
#define IS_CRC_INPUTDATA_FORMAT(FORMAT)          (((FORMAT) == CRC_InputDataFormat_BYTES)    || \
                                                    ((FORMAT) == CRC_InputDataFormat_HALFWORDS)|| \
                                                    ((FORMAT) == CRC_InputDataFormat_WORDS))


/* Exported types ------------------------------------------------------------*/


/* Exported functions --------------------------------------------------------*/
uint8_t CRC_Accumulate_8b(CRC_TypeDef* CRCx, uint8_t* pBuff, uint32_t u32Len);
uint16_t CRC_Calculate_8b(CRC_TypeDef* CRCx, uint8_t* pBuff, uint32_t u32Len);
uint8_t CRC_Accumulate_16b(CRC_TypeDef* CRCx, uint16_t* pBuff, uint32_t u32Len);
uint16_t CRC_Calculate_16b(CRC_TypeDef* CRCx, uint16_t* pBuff, uint32_t u32Len);
uint8_t CRC_Accumulate_32b(CRC_TypeDef* CRCx, uint32_t* pBuff, uint32_t u32Len);
uint16_t CRC_Calculate_32b(CRC_TypeDef* CRCx, uint32_t* pBuff, uint32_t u32Len);
uint32_t CRC_Calculate(uint8_t InputType, uint32_t pBuffer[], uint32_t BufferLength);
ErrorStatus CRC_GetResultFlag(CRC_TypeDef* CRCx);


/**
  * @}
  */

#ifdef __cplusplus
}
#endif

#endif /* __tc32l010_CRC_H */

/************************ (C) COPYRIGHT CHIPAT *****END OF FILE****/
